package cn.stylefeng.guns.modular.household.service.impl;

import cn.stylefeng.guns.modular.household.entity.HouseholdMember;
import cn.stylefeng.guns.modular.household.mapper.HouseholdMemberMapper;
import cn.stylefeng.guns.modular.household.service.HouseholdMemberService;
import cn.stylefeng.roses.kernel.rule.enums.YesOrNotEnum;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.io.Serializable;
import java.util.List;

/**
 * 家庭成员服务实现层
 *
 * @author lichenhui
 * @date 2024/03/20
 */
@Service
public class HouseholdMemberServiceImpl extends ServiceImpl<HouseholdMemberMapper, HouseholdMember> implements HouseholdMemberService {

    @Override
    public List<HouseholdMember> listByHouseholdId(Serializable householdId) {
        LambdaQueryWrapper<HouseholdMember> memberWrapper = new LambdaQueryWrapper<>();
        memberWrapper.eq(HouseholdMember::getHouseholdId, householdId);
        memberWrapper.eq(HouseholdMember::getDelFlag, YesOrNotEnum.N.getCode());
        return this.list(memberWrapper);
    }

}
